package tools

import (
	"google.golang.org/protobuf/proto"
	"utilsx/constant"
)

func JsonProtoToObj[T proto.Message](content []byte) ([]byte, T) {
	var ss T
	err := constant.Json.Unmarshal(content, &ss)
	if err != nil {
		panic(err)
	}
	marshal, err := constant.Json.Marshal(ss)
	if err != nil {
		panic(err)
	}
	return marshal, ss
}
